var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var $2EventCenter = require("EventCenter");
var $2PoolManager = require("PoolManager");
var $2BaseUI = require("BaseUI");
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var def_mylabel = /* */function (_a$BaseUI3) {
  function _ctor() {
    var _this187;
    babel_classCallCheck(this, _ctor);
    _this187 = _callSuper(this, _ctor, arguments);
    _this187.type = null;
    _this187.num = "";
    _this187.size = 32;
    _this187.regisEvent = false;
    _this187.lasttext = "";
    _this187.make = 0;
    _this187._color = cc.color(255, 255, 255);
    return _this187;
  }
  babel_inherits(_ctor, _a$BaseUI3);
  return babel_createClass(_ctor, [{
    key: "test",
    value: function test() {
      this.string = this.num;
      return true;
    }
  }, {
    key: "string",
    get() {
      return this.num;
    },
    set(e) {
      this.num = e;
      if (this.num == this.lasttext) {
        return;
      }
      this.make++;
      this.lasttext = this.num;
      $2PoolManager.default.getInstance().putAllChildren(this.node);
      var t = this.type.data.width / this.size;
      var n = this.type.data.width / t;
      var o = this.type.data.height / t;
      for (var _i43 = 0; _i43 < this.num.length; _i43++) {
        var _e104 = $2PoolManager.default.getInstance().get(this.type);
        _e104.active = true;
        _e104.color = this.color;
        _e104.width = n;
        _e104.height = o;
        this.node.addChild(_e104);
      }
    }
  }, {
    key: "color",
    get() {
      return this._color;
    },
    set(e) {
      this._color = e;
      var _iterator12 = babel_createForOfIteratorHelper(this.node.children);
      var _step12;
      try {
        for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
          var _t96 = _step12.value;
          _t96.color = this._color;
        }
      } catch (err) {
        _iterator12.e(err);
      } finally {
        _iterator12.f();
      }
    }
  }, {
    key: "onLoad",
    value: function onLoad() {
      this.string = this.num;
      this.regisEvent && $2EventCenter.default.regisEvent(this.node.name, this.setStr, this);
    }
  }, {
    key: "setStr",
    value: function setStr(e) {
      this.string = e;
    }
  }]);
}($2BaseUI.BaseUI);
def_mylabel.className = "mylabel";
cc__decorate([ccp_property({
  type: cc.Prefab,
  tooltip: "字体类型"
})], def_mylabel.prototype, "type", undefined);
cc__decorate([ccp_property({
  tooltip: "默认的数字",
  visible() {
    return this.test();
  }
})], def_mylabel.prototype, "num", undefined);
cc__decorate([ccp_property], def_mylabel.prototype, "size", undefined);
cc__decorate([ccp_property({
  tooltip: "是否需要注册事件，事件名字为节点名字"
})], def_mylabel.prototype, "regisEvent", undefined);
cc__decorate([ccp_property()], def_mylabel.prototype, "_color", undefined);
cc__decorate([ccp_property()], def_mylabel.prototype, "color", null);
def_mylabel = cc__decorate([ccp_ccclass], def_mylabel);
exports.default = def_mylabel;